/* Copyright (c) 2009-2010, Sean A.O. Harney <sharney3@gmail.com> */

#include "omf.h"

/* globals */
extern int yylineno;




void asl_append(LLIST_P * asl, ASL_NODE_P stmt)
{
    llist_append(stmt, asl);
}


void asl_print(FILE * fp, LLIST_P asl)
{
    LLIST_P walker;
    ASL_NODE_P stmt;

    if (asl != NULL)
      {
	  for (walker = asl; walker != NULL; walker = walker->next)
	    {
		stmt = walker->element;
		fprintf(fp, "\t %d\t%s()\n",
			stmt->lineno, stmt_type_to_str(stmt->type));
	    }
    } else
	fprintf(fp, "List is empty.\n");
    fflush(fp);

}

void asl_print_all(FILE * fp)
{
    symbol_tbl_print_all_functions(glob.symbol_tbl_global, fp);
}
